package us.mmapp;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import com.google.android.maps.MapView;

public class PinchMapView extends MapView
{
private OnMapActivity mapActivity;
private int mZoomScale;
	public void addClass(OnMapActivity mapA)
	{
		mapActivity = mapA;
	}

	public PinchMapView(Context context, String apiKey)
	{
		super(context, apiKey);
		mZoomScale=getZoomLevel();
	}

	public PinchMapView(Context context, AttributeSet attrs)
	{
		super(context, attrs);
		mZoomScale=getZoomLevel();
	}

	public PinchMapView(Context context, AttributeSet attrs, int defStyle)
	{
		super(context, attrs, defStyle);
		mZoomScale=getZoomLevel();
	}

	public boolean onTouchEvent(MotionEvent event)
	{
		if(mZoomScale!=getZoomLevel())
			mapActivity.updateMapWithCluster();
		mZoomScale=getZoomLevel();
		
		return super.onTouchEvent(event);
	}

}
